package org.tc.client.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.tc.client.entity.Shoppingcar;
import org.tc.client.mapper.ShoppingcarMapper;
import org.tc.client.service.ShoppingcarService;

import java.util.List;

@RestController
public class ShoppingcarServiceImpl implements ShoppingcarService {


    @Autowired
    private ShoppingcarMapper shoppingcarMapper;

    @Override
    public int deleteShopCarById(Integer id) {
        return shoppingcarMapper.deleteShopCarById(id);
    }

    @Override
    public int insertShopCar(@RequestBody Shoppingcar shoppingcar) {
        return shoppingcarMapper.insertShopCar(shoppingcar);
    }

    @Override
    public List<Shoppingcar> selectShopCarByUserId(Integer userid) {
        List<Shoppingcar> list = shoppingcarMapper.selectShopCarByUserId(userid);
        return list;
    }

    @Override
    public int updateByPrimaryKey(Shoppingcar record) {
        return 0;
    }

    @Override
    public List<Shoppingcar> getShopByState(@RequestBody Shoppingcar shoppingcar) {
        List<Shoppingcar> list = shoppingcarMapper.getShopByState(shoppingcar);
        return list;
    }

    @Override
    public int updShopState(@RequestBody Shoppingcar shoppingcar) {
        int count = shoppingcarMapper.updShopState(shoppingcar);
        return count;
    }
}
